package com.itheima.lambda.practice01;

public class EatableDemo {
    public static void main(String[] args) {
        new Eatable() {
            @Override
            public void eat() {
                System.out.println("kkkk");
            }
        }.eat();

        userEatable(new Eatable() {
            @Override
            public void eat() {
                System.out.println("一天一苹果，医生远离我");
            }
        });
     userEatable(()->{
         System.out.println("一天一苹果，医生远离我");
     });
    }

    public static  void userEatable(Eatable eatable){
        eatable.eat();
    }
}
interface Eatable{
    void  eat();
}
